package com.magnificent.panda.model.entity;

import com.silverhaze.commons.utils.collections.list.MetaArrayList;
import com.silverhaze.commons.utils.collections.list.MetaList;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * User: Babanin
 * Date: 13.03.2010
 * Time: 1:24:50
 */
public class FlowActor implements Serializable {
    private FlowActor partner;

    private String name;
    private MetaList<FlowEvent> events;
    private FlowActorType actorType;

    public FlowActor() {
        name = "FlowActor";
        partner = null;
        events = new MetaArrayList<FlowEvent>();
        actorType = new FlowActorType(0);
    }

    public FlowActor(String name) {
        this.name = name;
        events = new MetaArrayList<FlowEvent>();
    }

    public FlowActor getPartner() {
        return partner;
    }

    public void setPartner(FlowActor partner) {
        this.partner = partner;
    }

    public MetaList<FlowEvent> getEvents() {
        return events;
    }

    public void setEvents(MetaList<FlowEvent> events) {
        this.events = events;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Long> getEventTimes(){
        List<Long> values = new ArrayList<Long>();

        for (FlowEvent flowEvent : events) {
            values.add(flowEvent.getValue());
        }

        return values;
    }

    public FlowActorType getActorType() {
        return actorType;
    }

    public void setActorType(FlowActorType actorType) {
        this.actorType = actorType;
    }
}

  /* converted to utf8 */